package com.xiaopengwei.springboot.rabbitmq.rabbit.object;import com.xiaopengwei.springboot.rabbitmq.entity.User;import org.springframework.amqp.core.AmqpTemplate;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Component;/** * <p> *ObjectSender * </p> * * @author XiaoPengwei.com * @since 2019-04-20 */@Componentpublic class ObjectSender {    @Autowired    private AmqpTemplate rabbitTemplate;    public void send(User user) {        System.out.println("Sender object: " + user.toString());        this.rabbitTemplate.convertAndSend("object", user);    }}